package conf

type Conf struct {
	Server Server `json:"server" yaml:"server"`
	DB     DB     `json:"db"  yaml:"db"`
	Log    Log    `json:"log" yaml:"log"`
	Redis  Redis  `json:"redis" yaml:"redis"`
	Email  Email  `json:"email" yaml:"email"`
}
type Server struct {
	AppMode  string `mapstructure:"app-mode" json:"app-mode" yaml:"app-mode"`
	HttpPort string `mapstructure:"http-port" json:"http-port" yaml:"http-port"`
	IP       string `json:"ip" yaml:"ip"`
}
type DB struct {
	Host string `json:"host"  yaml:"host"`
	Port string `json:"port" yaml:"port"`
	User string `json:"user" yaml:"user"`
	Pwd  string `json:"pwd" yaml:"pwd"`
	Name string `json:"name" yaml:"name"`
}
type Log struct {
	FileName      string `mapstructure:"file-name" json:"file-name"  yaml:"file-name"`
	MaxSize       int    `mapstructure:"max-size" json:"max-size"  yaml:"max-size"`
	MaxBackups    int    `mapstructure:"max-backups" json:"max-backups"  yaml:"max-backups"`
	MaxAge        int    `mapstructure:"max-age" json:"max-age" yaml:"max-age"`
	Compress      bool   `mapstructure:"compress  json:"compress" yaml:"compress"`
	Encoder       string `mapstructure:"encoder" json:"encoder" yaml:"encoder"`
	Level         int8   `mapstructure:"level" json:"level"  yaml:"level"`
	OutputConsole bool   `mapstructure:"output-console" json:"output-console"  yaml:"output-console"`
}
type Redis struct {
	Addr string `json:"addr" yaml:"addr"`
	Pwd  string `json:"pwd" yaml:"pwd"`
	Name int    `json:"name" yaml:"name"`
	Size int    `json:"size" yaml:"size"`
}
type Email struct {
	To       string `mapstructure:"to" json:"to" yaml:"to"`                   // 收件人:多个以英文逗号分隔
	Port     string `mapstructure:"port" json:"port" yaml:"port"`             // 端口
	From     string `mapstructure:"from" json:"from" yaml:"from"`             // 收件人
	Host     string `mapstructure:"host" json:"host" yaml:"host"`             // 服务器地址
	IsSSL    bool   `mapstructure:"is-ssl" json:"is-ssl" yaml:"is-ssl"`       // 是否SSL
	Secret   string `mapstructure:"secret" json:"secret" yaml:"secret"`       // 密钥
	Nickname string `mapstructure:"nickname" json:"nickname" yaml:"nickname"` // 昵称
}
